<?php

namespace App\Http\Controllers\Miniprograme;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class ServerController extends ComController
{
    public function serve()
    {
        $this->miniProgram->server->push(function($message){
            if(method_exists(new UseMessageController,$message['MsgType'])){
                $methods = $message['MsgType'];//获取方法变量
                $data =  UseMessageController::$methods($message);
                return $data;
            }
            return "欢迎关注 志祥网络科技！";
        });
        return $this->miniProgram->server->serve();
    }
}
